home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 4_2005-2006.ISO / data / Zips / remote_blu1966941212006.psc / remote bluetooth shell exe.frm < prev    next >
Text File  |  2006-01-22  |  11KB  |  406 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Remote Bluetooth  Shell Execution"
  5.    ClientHeight    =   8145
  6.    ClientLeft      =   600
  7.    ClientTop       =   840
  8.    ClientWidth     =   7605
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   8145
  13.    ScaleWidth      =   7605
  14.    ShowInTaskbar   =   0   'False
  15.    Tag             =   "`"
  16.    Begin VB.DriveListBox Drive1 
  17.       Height          =   315
  18.       Left            =   240
  19.       TabIndex        =   15
  20.       Top             =   1560
  21.       Width           =   3015
  22.    End
  23.    Begin VB.DirListBox Dir1 
  24.       Height          =   2565
  25.       Left            =   240
  26.       TabIndex        =   13
  27.       Top             =   2160
  28.       Width           =   3015
  29.    End
  30.    Begin VB.FileListBox File1 
  31.       Height          =   1650
  32.       Left            =   240
  33.       Pattern         =   "*.txt"
  34.       TabIndex        =   11
  35.       Top             =   5280
  36.       Width           =   3015
  37.    End
  38.    Begin VB.PictureBox Picture1 
  39.       BorderStyle     =   0  'None
  40.       Height          =   495
  41.       Left            =   2040
  42.       Picture         =   "remote bluetooth shell exe.frx":0000
  43.       ScaleHeight     =   495
  44.       ScaleWidth      =   1935
  45.       TabIndex        =   5
  46.       Top             =   0
  47.       Width           =   1935
  48.    End
  49.    Begin VB.CommandButton cmdexit 
  50.       Caption         =   "E&xit"
  51.       BeginProperty Font 
  52.          Name            =   "Comic Sans MS"
  53.          Size            =   12
  54.          Charset         =   0
  55.          Weight          =   400
  56.          Underline       =   0   'False
  57.          Italic          =   0   'False
  58.          Strikethrough   =   0   'False
  59.       EndProperty
  60.       Height          =   495
  61.       Left            =   3000
  62.       TabIndex        =   4
  63.       Top             =   7080
  64.       Width           =   1035
  65.    End
  66.    Begin VB.CommandButton Command2 
  67.       Caption         =   "Disable"
  68.       BeginProperty Font 
  69.          Name            =   "Comic Sans MS"
  70.          Size            =   12
  71.          Charset         =   0
  72.          Weight          =   400
  73.          Underline       =   0   'False
  74.          Italic          =   0   'False
  75.          Strikethrough   =   0   'False
  76.       EndProperty
  77.       Height          =   495
  78.       Left            =   1680
  79.       TabIndex        =   1
  80.       Top             =   7080
  81.       Width           =   1095
  82.    End
  83.    Begin VB.Timer Timer1 
  84.       Enabled         =   0   'False
  85.       Interval        =   1000
  86.       Left            =   1080
  87.       Top             =   960
  88.    End
  89.    Begin VB.CommandButton Command1 
  90.       Caption         =   "Enable"
  91.       BeginProperty Font 
  92.          Name            =   "Comic Sans MS"
  93.          Size            =   12
  94.          Charset         =   0
  95.          Weight          =   400
  96.          Underline       =   0   'False
  97.          Italic          =   0   'False
  98.          Strikethrough   =   0   'False
  99.       EndProperty
  100.       Height          =   495
  101.       Left            =   240
  102.       TabIndex        =   0
  103.       Top             =   7080
  104.       Width           =   1215
  105.    End
  106.    Begin VB.Timer Timer3 
  107.       Enabled         =   0   'False
  108.       Interval        =   1000
  109.       Left            =   600
  110.       Top             =   960
  111.    End
  112.    Begin VB.Label Label4 
  113.       Caption         =   $"remote bluetooth shell exe.frx":08B6
  114.       BeginProperty Font 
  115.          Name            =   "MS Sans Serif"
  116.          Size            =   9.75
  117.          Charset         =   0
  118.          Weight          =   700
  119.          Underline       =   0   'False
  120.          Italic          =   0   'False
  121.          Strikethrough   =   0   'False
  122.       EndProperty
  123.       ForeColor       =   &H000000FF&
  124.       Height          =   1680
  125.       Left            =   4320
  126.       TabIndex        =   16
  127.       Top             =   5280
  128.       Width           =   3135
  129.    End
  130.    Begin VB.Label lblheading 
  131.       AutoSize        =   -1  'True
  132.       Caption         =   "Shell Execution"
  133.       BeginProperty Font 
  134.          Name            =   "Arial"
  135.          Size            =   22.5
  136.          Charset         =   0
  137.          Weight          =   700
  138.          Underline       =   0   'False
  139.          Italic          =   0   'False
  140.          Strikethrough   =   0   'False
  141.       EndProperty
  142.       ForeColor       =   &H00FF0000&
  143.       Height          =   525
  144.       Index           =   1
  145.       Left            =   4080
  146.       TabIndex        =   14
  147.       Top             =   0
  148.       Width           =   3330
  149.    End
  150.    Begin VB.Label Label3 
  151.       AutoSize        =   -1  'True
  152.       Caption         =   "Text Files Present In The Above Folder Path"
  153.       BeginProperty Font 
  154.          Name            =   "MS Sans Serif"
  155.          Size            =   9.75
  156.          Charset         =   0
  157.          Weight          =   700
  158.          Underline       =   0   'False
  159.          Italic          =   0   'False
  160.          Strikethrough   =   0   'False
  161.       EndProperty
  162.       Height          =   240
  163.       Left            =   240
  164.       TabIndex        =   12
  165.       Top             =   4920
  166.       Width           =   4590
  167.    End
  168.    Begin VB.Label Label2 
  169.       Caption         =   $"remote bluetooth shell exe.frx":093E
  170.       Height          =   3015
  171.       Left            =   4320
  172.       TabIndex        =   10
  173.       Top             =   1680
  174.       Width           =   2535
  175.    End
  176.    Begin VB.Label Label1 
  177.       AutoSize        =   -1  'True
  178.       Caption         =   "Instructions :"
  179.       BeginProperty Font 
  180.          Name            =   "WST_Engl"
  181.          Size            =   18
  182.          Charset         =   2
  183.          Weight          =   700
  184.          Underline       =   0   'False
  185.          Italic          =   0   'False
  186.          Strikethrough   =   0   'False
  187.       EndProperty
  188.       Height          =   360
  189.       Left            =   4320
  190.       TabIndex        =   9
  191.       Top             =   1200
  192.       Width           =   2100
  193.    End
  194.    Begin VB.Label Label11 
  195.       Caption         =   "2006 Satish Surath"
  196.       Height          =   255
  197.       Left            =   480
  198.       TabIndex        =   8
  199.       Top             =   600
  200.       Width           =   3975
  201.    End
  202.    Begin VB.Label Label10 
  203.       Caption         =   "⌐"
  204.       BeginProperty Font 
  205.          Name            =   "MS Sans Serif"
  206.          Size            =   12
  207.          Charset         =   0
  208.          Weight          =   400
  209.          Underline       =   0   'False
  210.          Italic          =   0   'False
  211.          Strikethrough   =   0   'False
  212.       EndProperty
  213.       Height          =   255
  214.       Left            =   240
  215.       TabIndex        =   7
  216.       Top             =   480
  217.       Width           =   255
  218.    End
  219.    Begin VB.Label Label9 
  220.       Caption         =   "This Programme Was Designed For Demonstration Purpose Only With No Warranty/Liability Either Implied Or Expressed."
  221.       Height          =   495
  222.       Left            =   240
  223.       TabIndex        =   6
  224.       Top             =   7680
  225.       Width           =   4335
  226.    End
  227.    Begin VB.Label lblrefresh 
  228.       AutoSize        =   -1  'True
  229.       BeginProperty Font 
  230.          Name            =   "Comic Sans MS"
  231.          Size            =   11.25
  232.          Charset         =   0
  233.          Weight          =   400
  234.          Underline       =   0   'False
  235.          Italic          =   0   'False
  236.          Strikethrough   =   0   'False
  237.       EndProperty
  238.       Height          =   300
  239.       Left            =   4440
  240.       TabIndex        =   3
  241.       Top             =   7080
  242.       Width           =   60
  243.    End
  244.    Begin VB.Label lblheading 
  245.       Caption         =   "Remote"
  246.       BeginProperty Font 
  247.          Name            =   "Arial"
  248.          Size            =   22.5
  249.          Charset         =   0
  250.          Weight          =   700
  251.          Underline       =   0   'False
  252.          Italic          =   0   'False
  253.          Strikethrough   =   0   'False
  254.       EndProperty
  255.       ForeColor       =   &H00FF0000&
  256.       Height          =   495
  257.       Index           =   0
  258.       Left            =   240
  259.       TabIndex        =   2
  260.       Top             =   0
  261.       Width           =   1695
  262.    End
  263. End
  264. Attribute VB_Name = "Form1"
  265. Attribute VB_GlobalNameSpace = False
  266. Attribute VB_Creatable = False
  267. Attribute VB_PredeclaredId = True
  268. Attribute VB_Exposed = False
  269. Option Explicit
  270. Dim pin As Variant
  271. Dim t1 As Variant
  272. Dim t2 As Variant
  273. Dim t3 As Variant
  274. Dim t4 As Variant
  275. Dim t5 As Variant
  276. Dim t6 As Variant
  277. Dim t7 As Variant
  278. Dim t8 As Variant
  279. Dim t9 As Variant
  280. Dim t10 As Variant
  281. Dim binpin As Integer
  282. Dim strFileName As String
  283. Dim m As Variant
  284. Dim flag As Integer
  285. Dim filenum As Variant
  286. Dim tim As Integer
  287. Dim counter As Integer
  288. Private Declare Function ShellExecute Lib "shell32.dll" _
  289.     Alias "ShellExecuteA" _
  290.     (ByVal hwnd As Long, _
  291.     ByVal lpOperation As String, _
  292.     ByVal lpFile As String, _
  293.     ByVal lpParameters As String, _
  294.     ByVal lpDirectory As String, _
  295.     ByVal nShowCmd As Long) As Long
  296.     Private Declare Function GetWindowsDirectory Lib "kernel32.dll" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
  297. Private Sub cmdexit_Click()
  298.  
  299. End
  300. End Sub
  301.  
  302.  
  303. Private Sub Command1_Click()
  304. Timer1.Enabled = True
  305. Timer3.Enabled = True
  306. Command2.Enabled = True
  307. Command1.Enabled = False
  308. End Sub
  309.  
  310. Private Sub Command2_Click()
  311. Timer1.Enabled = False
  312. Timer3.Enabled = False
  313. Command1.Enabled = True
  314. Command2.Enabled = False
  315. End Sub
  316.  
  317.  
  318. Private Sub Dir1_Change()
  319. File1.Path = Dir1.Path
  320. File1.Refresh
  321. End Sub
  322.  
  323.  
  324.  
  325. Private Sub Drive1_Change()
  326. On Error GoTo Trap
  327. Dir1.Path = Drive1.Drive
  328. Trap:
  329. Exit Sub
  330. End Sub
  331.  
  332. Private Sub Form_Load()
  333. strFileName = "c:\out.por"
  334. counter = 1
  335. Command2.Enabled = False
  336. Command1.Enabled = True
  337. tim = 1
  338. Dir1.Path = "c:\"
  339. File1.Path = "c:\"
  340.  
  341.  
  342.  
  343. End Sub
  344.  
  345.  
  346. Private Sub Timer1_Timer()
  347. Dim r As Long
  348. On Error GoTo Trap
  349.  
  350. filenum = FreeFile
  351.  
  352. Open strFileName For Input As filenum
  353.  
  354. m = Input(LOF(filenum), filenum)
  355.  
  356.  
  357.     r = ShellExecute(Me.hwnd, "open", m, 0&, fGetWinDir, 1)
  358.         
  359.         
  360.         
  361.         
  362.  
  363. Close filenum
  364.  
  365. Kill (strFileName)
  366.  
  367.  
  368.  
  369. Trap:
  370. Exit Sub
  371.  
  372. End Sub
  373.  
  374.  
  375. Private Sub Timer3_Timer()
  376. File1.Refresh
  377. If File1.ListCount > 0 Then
  378. File1.Selected(0) = True
  379. End If
  380. strFileName = File1.Path + File1.Filename
  381.  
  382.  
  383.  
  384. If counter <= 10 Then
  385. lblrefresh.Caption = ""
  386. counter = counter + 1
  387. End If
  388. If counter = 4 Then
  389. lblrefresh.Caption = "Refreshing system info.."
  390. counter = 0
  391. End If
  392. End Sub
  393. Private Function fGetWinDir() As String
  394. ' Wrapper to return OS Path
  395. Dim lRet As Long, lSize As Long, sBuf As String * 512
  396.     
  397.     
  398.     lSize = 512
  399.     lRet = GetWindowsDirectory(sBuf, lSize)
  400.     fGetWinDir = Left(sBuf, InStr(1, sBuf, Chr(0)) - 1)
  401.  
  402.  
  403.     
  404. End Function
  405.  
  406.